'use strict';
 
module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  // 下面得操作是连接数据库
  const OltSchema = new Schema({
    // 修改和新增用到，规定字段得类型和其他条件等
    _id: {
        type: String,
        primaryKey: true
    },  
    oltType : { type:String },
    name:{ type: String },
    oltIP:{type: String},
    telnetTCPPort:{type: String},  
    oltTelnetUsername:{type: String},
    oltTelnetPassword:{type: String},
    oltManagementPassword:{type: String},
    initCommunity:{type:String},
    snmpUDPPort:{type: String},
    ACSVlan:{type:String},
    oltHardVersion:{type: String},
    oltHardwareVersion:{type:String},
    oltSoftwareVersion:{type: String},
    systemName:{type: String},
    systemTime:{type: String},
    runningTime:{type: String},
    cpuUsage:{type: String},
    memoryUsage:{type: String},
    MCIndex:{type:String},
    temperature:{type:String},
    onlineState:{type: Boolean},
    RZUsername:{type:String},
    RZPassword:{type:String},
    telnetProxySwitch:{type:Boolean,default:true},
    tid:{type: String},
  });
 
  return mongoose.model('Olt', OltSchema,'olt'); // 我的理解：Article是指定查找的入口，随便取；ArticleSchema是参数；article是你数据集合表的名称
};